<div id="pageoptions">
    <%= link_to "new category", {# link_to options
            :controller => 'category',
            :action => 'new'} %>
</div>
<div class="pagination">
    <% if @category_pages.length > 1 then  %>
        <%= if !@category_pages.current.first? then link_to "&lt; Prev", :page=>@category_pages.current.previous else "&lt; Prev" end  %>
         <%= pagination_links(@category_pages) %>
         <%= if !@category_pages.current.last? then link_to "Next &gt;", :page=>@category_pages.current.next else "Next &gt;" end %>
    <% end %>
</div>
    <% for category in @categories %>
        <div class="sectionwrap">
            <div class="sectiontitle">
            <%= link_to "#{category.title}", {# link_to options
                                    :controller => 'story',
                                    :action => 'in_category',
                                    :id => category.title
                                    } %></div>
            <div class="storydates">Created: <%= h(category.created_at.strftime(" %m/%d/%Y %I:%M%p")) %>  <%= if category.updated_at then "Modified: #{h(category.updated_at.strftime(' %m/%d/%Y %I:%M%p'))}" end %></div>          
            <div class="sectionlinks">
                <ul>
                    <li><%= link_to "stories", {# link_to options
                                        :controller => 'story',
                                        :action => 'in_category',
                                        :id => category.title
                                        } %></li>
                    <li><%= link_to "words", {# link_to options
                                :controller => 'word',
                                :action => 'in_category',
                                :id => category.title
                                } %></li>
                    <li><%= link_to "edit", {# link_to options
                                        :controller => 'category',
                                        :action => 'edit',
                                        :id => category.id
                                        } %></li>
                    <li><%= link_to "delete", {# link_to options
                                    :controller => 'category',
                                    :action => 'delete',
                                    :id => category.id },
                                    { # html options
                                        :method => :post,
                                        :confirm => "Really delete category #{category.title}?\n\nNote: This will not delete any stories associated with this category."
                                    } %></li>
                </ul>
            </div>
        </div>
    <% end %>
<div class="pagination">
    <% if @category_pages.length > 1 then  %>
        <%= if !@category_pages.current.first? then link_to "&lt; Prev", :page=>@category_pages.current.previous else "&lt; Prev" end  %>
         <%= pagination_links(@category_pages) %>
         <%= if !@category_pages.current.last? then link_to "Next &gt;", :page=>@category_pages.current.next else "Next &gt;" end %>
    <% end %>
</div>